package danhmuc;


import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.JToolBar;

import trangchu.TrangChu;


import danhmuc.NhaPhanPhoi;
import java.awt.GridLayout;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import net.miginfocom.swing.MigLayout;
import java.awt.Insets;
import javax.swing.JScrollPane;

import Table.TNhaPhanPhoi;

import java.awt.BorderLayout;

public class NhaPhanPhoi extends JPanel implements ActionListener {
	private JToolBar Toolbar;
	private JButton btnAdd,btnEdit,btnDelete,btnExcelIn,btnPrint,btnRefresh;
	private TrangChu trangchu;
	private TNhaPhanPhoi table = new TNhaPhanPhoi(null);
	private JPanel panel, panel2;
	private JScrollPane scrollPane;
	
	
	
	public NhaPhanPhoi(TrangChu trangchu){
		
		//Giao dien
								this.trangchu = trangchu;
								this.setLayout(new BorderLayout(5,5));

																				
											panel = new JPanel();
											panel.setLayout(new BorderLayout());
											this.add(panel,BorderLayout.NORTH);
				
											this.Toolbar = new JToolBar();
											panel.add(Toolbar);
											this.Toolbar.setOrientation(JToolBar.HORIZONTAL);
											this.btnAdd = new JButton("New",new ImageIcon("images/ButAdd.gif"));
											this.btnAdd.setVerticalTextPosition(JButton.BOTTOM);
											this.btnAdd.setHorizontalTextPosition(JButton.CENTER);
											
											this.Toolbar.add(this.btnAdd);
											this.Toolbar.setOrientation(JToolBar.HORIZONTAL);
											this.btnEdit = new JButton("Edit",new ImageIcon("images/ButEdit.gif"));
											this.btnEdit.setVerticalTextPosition(JButton.BOTTOM);
											this.btnEdit.setHorizontalTextPosition(JButton.CENTER);
											this.Toolbar.add(this.btnEdit);
											this.Toolbar.setOrientation(JToolBar.HORIZONTAL);
											this.btnDelete = new JButton("Delete",new ImageIcon("images/ButDelete.gif"));
											this.btnDelete.setVerticalTextPosition(JButton.BOTTOM);
											this.btnDelete.setHorizontalTextPosition(JButton.CENTER);
											this.Toolbar.add(this.btnDelete);
											this.Toolbar.setOrientation(JToolBar.HORIZONTAL);
											this.btnExcelIn = new JButton("Excel",new ImageIcon("images/ButExcelIn.gif"));
											this.btnExcelIn.setVerticalTextPosition(JButton.BOTTOM);
											this.btnExcelIn.setHorizontalTextPosition(JButton.CENTER);
											this.Toolbar.add(this.btnExcelIn);
											this.Toolbar.setOrientation(JToolBar.HORIZONTAL);
											this.btnPrint = new JButton("Print",new ImageIcon("images/ButPrint.gif"));
											this.btnPrint.setVerticalTextPosition(JButton.BOTTOM);
											this.btnPrint.setHorizontalTextPosition(JButton.CENTER);
											this.Toolbar.add(this.btnPrint);
											this.Toolbar.setOrientation(JToolBar.HORIZONTAL);
											
											this.btnRefresh = new JButton("Refresh",new ImageIcon("images/ButRefresh.gif"));
											this.btnRefresh.setVerticalTextPosition(JButton.BOTTOM);
											this.btnRefresh.setHorizontalTextPosition(JButton.CENTER);
											this.Toolbar.add(this.btnRefresh);
											this.Toolbar.setOrientation(JToolBar.HORIZONTAL);
											
											
								panel2 = new JPanel();
								panel2.setLayout(new BorderLayout());
								this.add(panel2,BorderLayout.CENTER);

								panel2.add(table, BorderLayout.NORTH);
								
								scrollPane = new JScrollPane();
								panel2.add(scrollPane, BorderLayout.SOUTH);
								
							
								
											
											
											
											
											// su kien
														this.btnAdd.addActionListener(this);
														this.btnEdit.addActionListener(this);
														this.btnDelete.addActionListener(this);
														this.btnExcelIn.addActionListener(this);
														this.btnPrint.addActionListener(this);
														this.btnPrint.addActionListener(this);
														
														
		
	}



	@Override
	public void actionPerformed(ActionEvent arg0) {
		// TODO Auto-generated method stub
		
	}
}